<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>业务受理</title>
	<link rel="stylesheet" type="text/css" href="<%=path%>/style/common.css">
	<link rel="stylesheet" type="text/css" href="<%=path%>/style/${windowStyle}/easyui/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=path%>/style/${windowStyle}/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=path%>/style/${windowStyle}/common.css">
	<link rel="stylesheet" type="text/css" href="<%=path%>/style/${windowStyle}/main.css">
	
	<script type="text/javascript" src="<%=path%>/js/common/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/common/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/common/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="<%=path%>/js/common/table-combogrib.js"></script>
	<script type="text/javascript" src="<%=path%>/js/common/commons-base.js"></script>
	<script type="text/javascript" src="<%=path%>/js/common/customReg.js"></script>
	<script type="text/javascript" src="<%=path%>/js/common/datetimebox.js"></script>
	<script type="text/javascript" src="<%=path%>/js/common/validateNum.js"></script>
	<script type="text/javascript" src="<%=path%>/js/sale/edit-sale.js"></script>
	<style type="text/css">
	.table-title {
		width:100px;
		text-align: right;
	}
	</style>
</head>
<body>
	<div class="page-hd">
		<div class="page-hd-title" id="titleName">新增托运单</div>
		<div class="page-hd-title-rcaption"></div>
		<div id="toolbar">
			<div id="toolbar-btn" class="f-l">
				<a href="#" class="easyui-linkbutton" iconCls="icon-save" id="save">保存</a>
				<a href="#" class="easyui-linkbutton" iconCls="icon-back" id="back">返回</a> 
				<a href="#" class="easyui-linkbutton" iconCls="icon-ok" id="confirmOK">确认</a>
				<a href="#" class="easyui-linkbutton" iconCls="icon-undo" id="unConfirmOK">取消确认</a>
			</div>

		</div>
	</div>
	<div class="page-bd">
		<div class="page-bd-saleInfro" style="border:1px">
			<form id="saleForm" method="post">
				<div id="saleInfor" style="height:178px;">
					<div title="托运信息" style="padding:5px;">
						<table width="100%">
							<tr>
								<input type="hidden" name="saleID" id="saleID"  value="${sale.saleID}" /> 
								<td class="table-title"> 托运编号:</td>
								<td class="table-value"> 
									<input  type="text" class="easyui-validatebox"  name="saleCode"  id="saleCode" value="${sale.saleCode}" style="width:140px;" >
								</td>
								
								<td class="table-title">托运方:</td>
								<td class="table-value">
									<input   type="text" class="easyui-validatebox" required="true" name="customer" id="customer" value="${sale.customer}" style="width:140px;" />
								</td>
								<td class="table-title">下单时间:</td>
								<td class="table-value">
									<input class="easyui-datebox" name="saleDate"  required="true" value="${sale.saleDate}" >
								</td>
								<td class="table-title">状态:</td>
								<td class="table-value">
									<input type="text" value="${sale.statusStr}" disabled="false" name="statusStr" id="statusStr"/>
									<input type="hidden" value="${sale.status}" name="status" id="status"/>
								</td>
								
							</tr>
							<tr>
								<td class="table-title">发货网点:</td>
								<td class="table-value" colspan="3">
									<input type="text" name="fromStation"  id="fromStation"  style="width:435px;" value="${sale.fromStationName}" class="easyui-validatebox" required="true"/>
									<input type="hidden" name="fromStationID" id="fromStationID" value="${sale.fromStationID}" /> 
								</td>
								<td class="table-title">发货地址:</td>
								<td colspan="4">
									<input  type="text" name="fromContactAddress"  style="width:425px;" value="${sale.fromContactAddress}" >
								</td>
							</tr>
							<tr>
								<td class="table-title">要求装货:</td>
								<td class="table-value">
									<input class="easyui-datetimebox"  name="fromStationDate"  value="${sale.fromStationDate}" style="width:140px;" >
								</td>
								<td class="table-title">发货联系人:</td>
								<td class="table-value">
									<input  type="text" name="fromContact " class="easyui-validatebox" required="true"   value="${sale.fromContact}" style="width:140px;"  >
								</td>
								<td class="table-title">发货方电话:</td>
								<td class="table-value">
									<input  type="text" name="fromContactTelephone" class="easyui-validatebox" required="true"  value="${sale.fromContactTelephone}" validType="customReg['(\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$','请输入正确的联系方式']">
								</td>
								<td class="table-title">&nbsp;</td>
								<td class="table-value">
								</td>
							</tr>
							
							<tr>
								<td class="table-title">收货网点:</td>
								<td class="table-value"  colspan="3">
									<input type="text" name="toStation" id="toStation" style="width:435px;" value="${sale.toStationName}"  class="easyui-validatebox" required="true"/>
									<input type="hidden" name="toStationID" id="toStationID" value="${sale.toStationID}"/>
								</td>
								<td class="table-title">收货地址:</td>
								<td colspan="4">
									<input  type="text" name="toContactAddress"  style="width:425px;" value="${sale.toContactAddress}">
								</td>
							</tr>
							
							<tr>
								<td class="table-title">要求到货:</td>
								<td class="table-value">
									<input class="easyui-datetimebox"   name="toStationDate"  value="${sale.toStationDate}" style="width:140px;" >
								</td>
								<td class="table-title">收货联系人:</td>
								<td class="table-value">
									<input  type="text" name="toContact" class="easyui-validatebox" required="true" value="${sale.toContact}" style="width:140px;" >
								</td>
								<td class="table-title">收货方电话:</td>
								<td class="table-value">
									<input  type="text" name="toContactTelephone" class="easyui-validatebox" required="true" value="${sale.toContactTelephone}" validType="customReg['(\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$','请输入正确的联系方式']">
								
								</td>
								<td class="table-title">总费用</td>
								<td class="table-value">
									<input  type="text" name="amountTotal" readonly="true" id = "amountTotal" value="${sale.amountTotal}" >
								</td>
							</tr>
							
							
							<tr>
								<td class="table-title">总数量:</td>
								<td>
									<input  type="text" name="qtyTotal" readonly="true" id = "qtyTotal"  value="${sale.qtyTotal}" style="width:140px;">
								</td>
								<td class="table-title">总毛重:</td>
								<td>
									<input  type="text" name="grossWeightTotal" readonly="true" id = "grossWeightTotal"  value="${sale.grossWeightTotal}" style="width:140px;">
								</td>
								<td class="table-title">总净重:</td>
								<td>
									<input  type="text" name="weightToTal" readonly="true" id = "weightTotal"  value="${sale.weightToTal}">
								</td>
								<td class="table-title">总体积:</td>
								<td>
									<input  type="text" name="volumeTotal" readonly="true" id = "volumeTotal"  value="${sale.volumeTotal}">
								</td>
							</tr>
						</table>
					</div>
					<div title="扩展信息1" style="padding:5px;">
						<table width="100%">
							<tr>
								<td class="table-title">业务类型:</td>
								<td class="table-value" >
									<input type='text' name="saleType" id="saleType"  style="width:260px" value="${sale.saleTypeName}"/>
									<input type="hidden" name="saleTypeID" id="saleTypeID" /> 
								</td>
								<td class="table-title">结算方式:</td>
								<td class="table-value" >
									<input type='text' name="payway" id="payway"  style="width:260px" value="${sale.paywayName}"/>
									<input type="hidden" name="paywayID" id="paywayID" /> 
								</td>
								<td class="table-title">提货方式:</td>
								<td class="table-value" >
									<input type='text' name="deliveryway" id="deliveryway"  style="width:260px" value="${sale.deliverywayName}"/>
									<input type="hidden" name="deliverywayID" id="deliverywayID" /> 
								</td>
							</tr>
							<tr>
								
								<td class="table-title">托运方式:</td>
								<td class="table-value" >
									<input type='text' name="shipment" id="shipment"  style="width:260px"value="${sale.shipmentName}"/>
									<input type="hidden" name="shipmentID" id="shipmentID" /> 
								</td>
							</tr>
						</table>
					</div>
				</div>
				<input type="hidden" name="goodsIDStr" id="goodsIDStr" /> 
				<input type="hidden" name="sizeStr" id="sizeStr" /> 
				<input type="hidden" name="weightStr" id="weightStr" /> 
				<input type="hidden" name="qtyStr" id="qtyStr" /> 
				<input type="hidden" name="unitStr" id="unitStr" /> 
				<input type="hidden" name="volumeStr" id="volumeStr" /> 
				<input type="hidden" name="grossWeightStr" id="grossWeightStr" /> 
				
				<input type="hidden" name="feeItemIDStr" id="feeItemIDStr" /> 
				<input type="hidden" name="amountStr" id="amountStr" /> 
				<input type="hidden" name="noteStr" id="noteStr" /> 
			</form>
		</div>
		
		
		<div id="saleDetailInfor" style="height:388px;">
			<div title="货物明细" style="padding:2px;">
				<div style="clear:both;padding:5px;">
					<div class="datagrid-toolbar">
						<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-add" id="addSaleDetail">新增</a>
						<a href="#" class="easyui-linkbutton"  plain="true" iconCls="icon-remove" id="deleteSaleDetail">删除</a>
					</div>
					<table id="saleDetailTable" class="datagrid-body">
						 <tr class="datagrid-header">
					      <td  width="200"  height="20px">
							  货物
					      </td>
					      <td  width="140" >
							  规格
						   </td>
					      <td width="140" > 
							 重量(吨)
						  </td>
					      <td width="140" >
							 数量
						  </td>
					      <td width="200" >
							 度量单位
						  </td>
						  <td width="140" >
							毛重(吨)
						  </td>
						   <td width="140" >
							 体积(m3)
						  </td>
					    </tr>
					    <%int i= 0; %>
					    <s:iterator value="#request.saleDetailList" var="saleDetail">
					    	<%i++; %>
					    <tr>
						   	<td>
							   	<input type="hidden" id="goodsID_<%=i%>"   name="goodsID" value="<s:property value='#saleDetail.goodsID'/>"/> 
							   
								<input type="text" name = "goods" id="goods_<%=i%>"  style="width:96%;"  onClick="javascript:onSelectGoods(this);" onfocus="changeColor(this)" 	value="<s:property value='#saleDetail.goodsName'/>"/> 
						   	</td>
						   	<td>
							<input type="text" name = "size" style="width:96%;" onfocus="changeColor(this)" value="<s:property value='#saleDetail.size'/>"/>  
						   	</td>
						   	<td>
							<input type="text" name = "weight" class="easyui-numberbox" style="width:96%;" onfocus="changeColor(this)"  onchange="changeWeight(this)" value="<s:property value='#saleDetail.weight'/>" /> 
						   	</td>
						   	<td>
							<input type="text" name = "qty" style="width:96%;" class="easyui-numberbox" onfocus="changeColor(this)" onchange="changeQty(this)" value="<s:property value='#saleDetail.qty'/>"/>  
						   	</td>
						   	<td>
						   	<input type="hidden" id="unitID_<%=i%>"    name="unitID" value="<s:property value='#saleDetail.unitID'/>"//> 
							<input type="text" name = "unit" id="unit_<%=i%>"  style="width:96%;"  onClick="javascript:onSelectUnit(this);"  onfocus="changeColor(this)" value="<s:property value='#saleDetail.unitName'/>"/> 
							
						   	</td>
						   	<td>
							<input type="text" name = "grossWeight" class="easyui-numberbox" style="width:96%;" onfocus="changeColor(this)" onchange="changeGrossWeight(this)" value="<s:property value='#saleDetail.grossWeight'/>"/> 
						   	</td>
						   	<td>
							<input type="text" name = "volume" class="easyui-numberbox" style="width:96%;" onfocus="changeColor(this)" onchange="changeVolume(this)" value="<s:property value='#saleDetail.volume'/>"/>  
						   	</td>
    					</tr>
					    	
						</s:iterator>
					    
					</table>
				</div>
			</div>
			
			<div title="应收费用明细" style="padding:2px;">
				<div style="clear:both;padding:5px;">
					<div class="datagrid-toolbar">
						<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-add" id="addSaleFee">新增</a>
						<a href="#" class="easyui-linkbutton"  plain="true" iconCls="icon-remove" id="deleteSaleFee">删除</a>
					</div>
					<table id="saleFeeTable" class="datagrid-body">
						 <tr class="datagrid-header">
					      <td  width="200"  height="20px" >
							  费用名称
					      </td>
					      <td  width="200" >
							  费用金额(元)
						   </td>
						   <td  width="200" >
							 备注
						   </td>
					    </tr>
					    <%i= 0; %>
					    <s:iterator value="#request.saleFeeList" var="saleFee">
					    	<%i++; %>
					    <tr>
						   	<td>
							   	<input type="hidden" id="feeItemID_<%=i%>"   name="feeItemID" value="<s:property value='#saleFee.feeItemID'/>"/> 
								<input type="text" name ="feeItem" id ="feeItem_<%=i%>" style="width:96%;"  onClick="javascript:onSelectFeeItem(this);" onfocus="changeColor(this)" value="<s:property value='#saleFee.feeItemName'/>"/> 
						   	</td>
						   	<td>
								<input type="text" name = "amount" style="width:96%;" onfocus="changeColor(this)" onchange="changeAmount(this)" value="<s:property value='#saleFee.amount'/>"/>  
						   	</td>
						   	<td>
								<input type="text" name = "note" style="width:96%;" onfocus="changeColor(this)"  value="<s:property value='#saleFee.note'/>"/> 
						   	</td>
						 </tr>
					    	
						</s:iterator>
					</table>
				</div>
			</div>
			
		</div>
	</div>
</body>
<script type="text/javascript">
  var js = '<%=basePath %>';
</script>
</html>
